<?php
$this->pageTitle = '订单确认';
?>
<style>
    .errormsg div.errorMessage{float:left;}
</style>
<div class="wp tm10 cl">
    <div class="order_steps cl">
        <div class="z txt f_14">下单流程</div>
        <ul class="z order_step_list cl">
            <li class="on">1.确认订单信息</li>
            <li>2.付款</li>
            <li>3.确认收货</li>
            <li>4.评价并获得积分</li>
        </ul>
    </div>
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'order-form',
        'enableClientValidation' => true,
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
    ));
    ?>
    <div class="cartbody tm10">
        <div class="boxhd"><b>确认收货地址</b></div>
        <div class="addresschoise">
            <ul id="addresslist">
                <?php
                foreach ($addresslist['GetUserContactInfoRsp']['list'] as $key => $value) {
                    $addresslistradio[$value['id']] = $value['recipients'] . '，' . $value['mobile'] . '，' . $value['province'] . '，' . $value['city'] . '，' . $value['area'] . '，' . $value['street'] . '，' . $value['streetDetail'] . '，' . $value['postalcode'];
                }
//                $addresslistradio[0] = "其他地址";
                echo $form->radioButtonList($model, 'userContactInfoId', $addresslistradio, array('template' => '<li class="cl">{input}{label}</li>', 'separator' => ''));
                ?>
                <li><a href="<?php echo $this->createUrl('home/address'); ?>" class="c_b">收货地址管理</a></li>
            </ul>
            <!--<div id="newaddress" class="zhbform" <?php if ($_POST['OrderForm']['userContactInfoId'] == null): ?>style="display: none;"<?php endif; ?>>
                <div class="cols1 cl">
                    <div class="col cl">
                        <div class="tit"><?php echo $form->labelEx($model, 'recipients'); ?>：</div>
                        <div class="inp cl"><div class="text"><?php echo $form->textField($model, 'recipients', array('style' => 'width:165px')); ?><span></span></div><?php echo $form->error($model, 'recipients'); ?></div>
                    </div>
                </div>
                <div class="cols1 cl tm10">
                    <div class="col cl">
                        <div class="tit"><?php echo $form->labelEx($model, 'mobile'); ?>：</div>
                        <div class="inp cl"><div class="text"><?php echo $form->textField($model, 'mobile', array('style' => 'width:165px')); ?><span></span></div></div>
                    </div>
                </div>
                <div class="cols1 cl tm10">
                    <div class="col cl">
                        <div class="tit"><?php echo $form->labelEx($model, 'streetDetail'); ?>：</div>
                        <div class="inp cl">
                            <div class="select z">
                                <?php echo $form->dropDownList($model, 'province', array('湖北省' => '湖北省'), array('empty' => '选择省')); ?>
                            </div>
                            <div class="select z lm15">
                                <?php echo $form->dropDownList($model, 'city', array('武汉市' => '武汉市'), array('empty' => '选择市')); ?>
                            </div>
                            <div class="select z lm15">
                                <?php echo $form->dropDownList($model, 'area', array('江汉区' => '江汉区', '硚口区' => '硚口区'), array('empty' => '选择区/县')); ?>
                            </div>
                            <div class="select z lm15">
                                <?php echo $form->dropDownList($model, 'street', array('中南路' => '中南路', '常青路' => '常青路'), array('empty' => '街道')); ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="cols1 cl tm10">
                    <div class="col cl">
                        <div class="tit"></div>
                        <div class="inp cl">
                            <div class="text"><?php echo $form->textField($model, 'streetDetail', array('style' => 'width:465px', 'placeholder' => '请输入详细地址或门牌号', 'class' => 'holder-input')); ?><span></span></div>
                        </div>
                    </div>
                </div>
                <div class="cols1 cl tm10">
                    <div class="col cl">
                        <div class="tit"><?php echo $form->labelEx($model, 'postalcode'); ?>：</div>
                        <div class="inp cl">
                            <div class="text"><?php echo $form->textField($model, 'postalcode', array('style' => 'width:165px')); ?><span></span></div>
                        </div>
                    </div>
                </div>
            </div>-->
        </div>
        <div class="boxhd tm20"><b>收货时间</b></div>
        <div class="tm20">
            <div class="cols1 cl">
                <div class="col cl">
                    <div class="inp cl">
                        <?php
                        foreach ($date as $key => $value) {
                            $datelist[$value['v']] = $value['n'];
                        }
                        //,'14:15' => '14:15','14:30' => '14:30','14:45' => '14:45','16:00' => '16:00','16:15' => '16:15','16:30' => '16:30','16:45' => '16:45','17:00' => '17:00','17:15' => '17:15','17:30' => '17:30','17:45' => '17:45','18:00' => '18:00','18:15' => '18:15','18:30' => '18:30','18:45' => '18:45','19:00' => '19:00','19:15' => '19:15','19:30' => '19:30','19:45' => '19:45','20:00' => '20:00'
                        ?>
                        <div class = "select z"><?php echo $form->dropDownList($model, 'receiptDate', $datelist, array('empty' => '选择日期')); ?></div>
                        <div class = "select z lm15"><?php echo $form->dropDownList($model, 'receiptTime', $ordertime, array('empty' => '选择时间')); ?></div>
                        <div class = "z lm15 c_gray">送餐时间为每天11:00 — 14:00，请提前30分钟下单，当前系统时间为：<?php echo date('Y-n-j H:i:s',time());?></div>
                    </div><?php // echo $form->error($model, 'receiptDate'); ?><?php // echo $form->error($model, 'productTotalPrice'); ?><?php // echo $form->error($model, 'receiptTime'); ?>
                </div>
            </div>
        </div>
        <div class="boxhd tm20"><b>餐品信息</b></div>
        <div class="orderfoodlist tm20">
            <ul class="cl">
                <li class="cl titles">
                    <div class="img z"></div>
                    <div class="wt foodname z">餐品名称</div>
                    <div class="wt foodprice z">单价（元）</div>
                    <div class="wt foodcount z">数量</div>
                    <div class="wt foodsprice z">小计</div>
                </li>
            </ul>
            <ul class="cl store-list-box"></ul>
        </div>
        <div class="boxhd tm20"><b>备注</b></div>
        <div class="note tm20">
            <?php echo $form->textArea($model, 'note',array('class'=>'notearea')); ?>
        </div>
    </div>
    <?php echo $form->hiddenField($model, 'paymentWay', array('value' => 1)); ?>
    <?php echo $form->hiddenField($model, 'orderState', array('value' => 1)); ?>
    <?php echo $form->hiddenField($model, 'deliverFee', array('value' => 0)); ?>
    <?php echo $form->hiddenField($model, 'productTotalPrice', array('value' => 0)); ?>
    <div class="cl tm20 cartbt cart-fix">
        <div class="z errormsg cl"><?php echo $form->error($model, 'userContactInfoId'); ?><?php echo $form->error($model, 'receiptTime'); ?><?php echo $form->error($model, 'receiptDate'); ?></div>
        <?php echo CHtml::submitButton('提交订单', array('class' => 'submit submit_blue y lm15 cart-buy-btn')); ?><span class="y" style="line-height:36px;">实付金额：<b class="c_orange f_20">￥<span class="cart-prices">0.00</span></b></span><span class="y" style="line-height:36px;margin-right: 20px;">配送费用：<b class="c_orange f_20" style="text-decoration: line-through">￥0.00</b></span>
    </div>
    <?php
    $this->endWidget();
    ?>
</div>
<script>
    $(document).ready(function() {
        ajaxGet('.store-list-box', 'getUserCart&t=order', 'account', 'html');
    });
</script>